<template>
	<fieldset>
		<legend>商品列表</legend>
		<ul>
			<li v-for="item in goods"
				:key="item.id">
                <!-- 将需要传递的参数(id),拼接到第二个路径路径 -->
				<router-link :to="{path:`/detail/${item.id}`}">{{item.title}}</router-link>
			</li>
		</ul>
	</fieldset>
</template>
<script>
	export default {
		mounted(){
			console.log(this.$route)
		},
		data() {
			return {
				goods: [
					{
						id: 1,
						title: '苹果'
					},
					{
						id: 2,
						title: '香蕉'
					}
				]
			}
		}
	}
</script>